<include file="Common:header" />
<!-- /. NAV SIDE  -->
<include file="Common:left" />
<!-- /. NAV SIDE  -->
<script type="text/javascript" charset="utf-8" src="__UEDITOR__/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__UEDITOR__/ueditor.all.js"></script>
<script type="text/javascript" src="__UEDITOR__/lang/zh-cn/zh-cn.js"></script>
<style type="text/css">
	.layui-upload-img{
		width:100px;
		height:100px;
		margin: 0 10px 10px 0;
	}
	.layui-upload-img2{
		width:200px;
		margin: 0 10px 10px 0;
	}
	.layui-upload-img3{
		width:50px;
	}
</style>
<div id="page-wrapper">
	<div class="header">
		<h1 class="page-header">
			配置管理 <small>Welcome {$Think.config.system_tag}</small>
		</h1>
		<ol class="breadcrumb">
			<li><a href="{:U('Index/index')}">首页</a></li>
			<li class="active">服务协议</li>
			<div style="float:right"><a href="javascript:history.go(-1);">返回</a></div>
		</ol> 
	</div>
	<div id="page-inner">
		<div class="row">
			<div class="col-xs-12">
				<!--Search content-->
				<div class="panel panel-default">
					<div class="panel-body">
						<form class="layui-form" action="" id="postform">
						    <input type="hidden" name="id" value="{$info.id}">
							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label">内容</label>
								<div class="layui-input-block">
								  <script type="text/plain" id="myEditor" name="value" style="width:100%;height:240px;">{$info.value}</script>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-input-block">
								  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
								  <button type="reset" class="layui-btn layui-btn-primary">重置</button>
								</div>
						  </div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<include file="Common:foot" />
	<script>
		//Demo
		var ue = UE.getEditor('myEditor');
		layui.use('form', function(){
		  var form = layui.form;
		  //监听提交
		  form.on('submit(formDemo)', function(data){
				var cont = $('#postform').serialize();
				$.ajax({
					url:"{:U('Configure/agreement')}",
					type:'post',
					dataType:'json',
					data:cont,
					success:function(data){
						if(data.code==0){
							layer.alert(data.message);
						}else{
							layer.alert(data.message, function(index){
								//do something
								window.parent.location.reload();
							});
						}
					}
				});
				//layer.msg(JSON.stringify(data.field));
				return false;
		  });
		});
	</script>
</div>
<include file="Common:footer" />